﻿<%@ Page Title="mt queue" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="crm_subscriber_import.aspx.cs" Inherits="Sami_SMS_CRM_UI.crm_subscriber_import" MaintainScrollPositionOnPostback="true" %>

<%@ Register Src="UserControl/ucPaging.ascx" TagName="ucPaging" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CssContent" runat="server">
    <style type="text/css">
        .box-content p{margin:2px 0 0 5px;}
        .box-content p input, .box-content p select{margin-bottom: 5px; padding: 4px 6px;}
        .box-content p span{display: inline-block; width: 80px; padding-left: 10px;}
        .detail{color: #555555; text-decoration:none;}
        .detail:hover{text-decoration:underline;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            RegisterDialog();
        });

        function CheckAll(checkbox) {
            CheckAllItem(checkbox, "rptTable");
        }
        function clearData(){
            ClearData("txtSubs,txtOperatorId,txtGatewayId,hdfAction");
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="box">
        <div class="box-title">
            Searching
        </div>
        <div class="box-content ui-widget-content">
            <p>
                <span>Subscriber</span>
                <asp:TextBox ID="txtSubscriber" runat="server" />
                <span>Collection</span>
                <asp:DropDownList ID="ddlCollection" runat="server" style="width:220px;" />
                <span>Service</span>
                <asp:DropDownList ID="ddlService3" runat="server" style="width:220px;" />
            </p>
            <p style="text-align:center">
                <asp:Button ID="btnSearching" runat="server" Text="Search" CssClass="ui-button" 
                    onclick="btnSearching_Click" />
            </p>
        </div>
    </div>
    <div class="box">
        <div class="box-title">
            <div class="fl">
                List of Subscriber
            </div>
            <div class="fr">
                <span style="border-left:1px solid #335A85;display:inline-block; height:30px; width: 40px; text-align:center">
                    <asp:ImageButton ID="ibtnDownLoad" runat="server" ImageUrl="~/img/icons/ws/ic_download.png"
                        ToolTip="Download upload pattern file" onclick="ibtnDownLoad_Click" />
                </span>
                <span style="border-left:1px solid #335A85;display:inline-block; height:30px; width: 40px; text-align:center">
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/icons/ws/ic_up.png"
                        ToolTip="Upload from file" OnClientClick="return OpenDialog('dialog-form2');" />
                </span>
                &nbsp;
                <span style="border-left:1px solid #335A85;display:inline-block; height:30px; width: 40px; text-align:center">
                    <asp:ImageButton ID="btnAddNew" runat="server" ImageUrl="~/img/icons/ws/ic_plus.png"
                        ToolTip="Add New" OnClientClick='clearData(); return OpenDialog("dialog-form1");' />
                </span>
                <span style="border-left:1px solid #335A85;display:inline-block; height:30px; width: 40px; text-align:center">
                    <asp:ImageButton ID="btnDeleteAll" runat="server" ImageUrl="~/img/icons/ws/ic_cancel.png"
                        ToolTip="Delete All" 
                    OnClientClick= "return confirm('Are you sure delete selected item?');" 
                    onclick="btnDeleteAll_Click" />
                </span>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="box-content">
            <div class="clearfix" style="height: 32px">
                <div class="fl">
                    Show
                    <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                        <asp:ListItem Value="5">5</asp:ListItem>
                        <asp:ListItem Value="10">10</asp:ListItem>
                        <asp:ListItem Value="20">20</asp:ListItem>
                        <asp:ListItem Value="50" Selected="True">50</asp:ListItem>
                        <asp:ListItem Value="100">100</asp:ListItem>
                        <asp:ListItem Value="150">150</asp:ListItem>
                        <asp:ListItem Value="200">200</asp:ListItem>
                    </asp:DropDownList> / 
                    <asp:Literal ID="ltrTotalRow" runat="server" Text="0" /> 
                    entries
                </div>
                <div class="fr">
                    <uc1:ucPaging ID="pagingtop" runat="server" />
                </div>
            </div>
            <div class="clearfix">
                <asp:GridView ID="rptTable" runat="server" AutoGenerateColumns="false" 
                    CssClass="table" Width="100%" onrowcommand="rptTable_RowCommand">
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="45px" HeaderText="No">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <%#(Container.DataItemIndex + 1) + (pagingtop.CurrentPage - 1) * pagingtop.PageSize%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="subscriber" DataField="subscriber" ItemStyle-Width="120px"/>
                        <asp:BoundField HeaderText="vasp_num" DataField="vasp_num" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px"/>
                        <asp:BoundField HeaderText="collection" DataField = "collection" />
                        <asp:BoundField HeaderText="operator_id" DataField="operator_id" ItemStyle-Width="100px"/>
                        <asp:BoundField HeaderText="gateway_id" DataField="gateway_id" ItemStyle-Width="100px"/>
                        <asp:BoundField HeaderText="service" DataField="service" ItemStyle-Width="100px"/>
                        <asp:TemplateField HeaderText="Control">
                            <ItemStyle Width="120px" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:LinkButton Text="Edit" runat="server" CommandName="Edited"
                                    CommandArgument='<%#Eval("guid_key")%>' />
                                    &nbsp;
                                <asp:LinkButton Text="Delete" runat="server" CommandName="Deleted"
                                    CommandArgument='<%#Eval("guid_key")%>' OnClientClick="return confirm('Are you sure delete?');" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText= "<input type='checkbox' title='Check all' id='chkCheckAll' onclick = 'CheckAll(this);'/>" >
                            <ItemStyle Width="60px" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:HiddenField ID="hdfItem" runat="server" Value='<%#Eval("guid_key")%>' />
                                <asp:CheckBox ID="chkItem" runat="server" Checked="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="fr">
                    <uc1:ucPaging ID="pagingbottom" runat="server" />
                </div>
            </div>
        </div>
    </div>
    <div class="dialog-form" id="dialog-form1" style="margin: auto; width: 480px; display:none;" title="subscriber">
        <div>
            <asp:HiddenField ID="hdfAction" runat="server" />
            <asp:HiddenField ID="hdfId" runat="server" />
            <p>
                <span>subscriber:</span>
                <asp:TextBox ID="txtSubs" runat="server" />
            </p>
            <p>
                <span>vasp_num</span>
                <asp:DropDownList ID="ddlSenderName" runat="server" />
            </p>   
            <p>
                <span>collection</span>
                <asp:DropDownList ID="ddlCollection2" runat="server" />
            </p>
            <p>
                <span>operator_id</span>
                <asp:TextBox ID="txtOperatorId" runat="server" />
            </p>
            <p>
                <span>gateway_id</span>
                <asp:TextBox ID="txtGatewayId" runat="server" />
            </p>
            <p>
                <span>service</span>
                <asp:DropDownList ID="ddlService" runat="server" />
            </p> 
            <div style="text-align: right; margin-top: 5px; padding-top: 5px; border-top: 1px solid #C3C3C3;">
                <asp:Button ID="btnOK" runat="server" Text="OK" CssClass="ui-button" 
                    onclick="btnOK_Click"  />
                <input type="button" value="Cancel" onclick='$("#dialog-form1").dialog("close");'
                    class="ui-button" />
            </div>
        </div>
    </div>
    <div class="dialog-form" id="dialog-form2" style="margin: auto; width: 480px; display:none;" title="upload">
        <div class="uploader">
            <p>
                <span>choose file</span><br />
                <asp:FileUpload ID="ful" runat="server" />
            </p>
            <br />
            <p>
                <span>collection</span>
                <asp:DropDownList ID="ddlCollection3" runat="server" />
            </p>
            <br />
            <p>
                <span>service</span>
                <asp:DropDownList ID="ddlService2" runat="server" />
            </p>
        </div>
        <div style="text-align: right; margin-top: 5px; padding-top: 5px; border-top: 1px solid #C3C3C3;">
            <asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="ui-button" 
                onclick="btnUpload_Click" />
            <input type="button" value="Cancel" onclick='$("#dialog-form2").dialog("close");'
                class="ui-button" />
        </div>
    </div>
    <input type="hidden" id="formId" value="crm_subscriber_import" />
</asp:Content>
